<style>
.margin-r {margin-right:28px}
</style>
<div ng-include="sys_html('home/_header',true,true)"></div>
<div class="register-container container" style="background:url( {{tomedia(main.lbg,true) || '../core/resource/images/bg-login.png'}}) no-repeat #18bc9c ;background-size: cover;">
    <div class="container-index">
        <div ng-class="{'register':1,'margin-r':main.istakeover !=1}">
			<div class="r" style="width:100%" ng-if="pagedata.wxauth!=1">
					<a class="wxlogincode" href="javascript:;" ng-click="pagedata.wechat_scan_login();">
						<img src="../core/resource/images/wxlogincode.png" border="0">
					</a>
					<div class="wxlogintitle">
							<img src="../core/resource/images/diy/icon/wechat.png" ></span>
							<span>微信安全登录</span>
					</div>
			</div>
			<div class="r" style="width:100%" ng-if="pagedata.wxauth==1">
					<a class="wxlogincode" href="javascript:;" ng-click="pagedata.wxauth=0">
						<img src="../core/resource/images/userlogincode.png" border="0">
					</a>
					<div class="wxlogintitle">
							<span>账号密码登录</span>
					</div>
			</div>
			<div class="forminfo" ng-if="pagedata.wxauth!=1">
            <form action="" method="post" role="form" id="form1">
				<div class="form-group fui-tab" ng-if="pagedata.mobile_code">
					<a ng-class="{'disabled':pagedata.item.login_type!=2,'active':pagedata.item.login_type==1}" ng-click="pagedata.item.login_type=1">账号登陆</a>
					<a ng-class="{'disabled':pagedata.item.login_type==2,'active':pagedata.item.login_type==2}" ng-click="pagedata.item.login_type=2">手机登陆</a>
				</div>
				<div class="form-group fui-tab" ng-if="!pagedata.mobile_code">
					<a class="active" ng-click="pagedata.item.login_type=1">账号登陆</a>
					<a class="disabled"></a>
				</div>
				<div style="margin-top:22px;">
					<div ng-show="pagedata.item.login_type==1">
						<div class="form-group">
							<div class="log-form-item">
								<input type="text" ng-model="pagedata.item.name" placeholder="输入您的账号" class="form-control log-input">
								<i class="icon icon-wo1"></i>
							</div>
						</div>
						<div class="form-group">
							<div class="log-form-item">
								<input type="password" ng-model="pagedata.item.password" placeholder="输入您的密码" class="form-control log-input">
								<i class="icon icon-mima"></i>
							</div>	
						</div>
					</div>
					<div class="form-group" ng-show="pagedata.item.login_type==2">
							<div class="log-form-item">
								<input type="text" ng-model="pagedata.item.mobile" placeholder="输入您的手机号" class="form-control log-input">
								<i class="icon icon-shumashouji"></i>
							</div>
					</div>
					<div class="form-group input-group" ng-show="pagedata.verify_code">
							<div class="input-group-addon"><i class="fa fa-info"></i></div>
							<input ng-model="pagedata.item.code" class="form-control" style="width:110px;" placeholder="请输入验证码">
							<a href="javascript:;" id="code" ng-click="code_image('imgverify')" style="text-decoration: none"><img id="imgverify" src="../core/resource/images/no_imgcode.png" style="height:44px;" title="点击图片更换验证码"/></a>
					</div>
					<div class="form-group input-group" ng-show="pagedata.item.login_type==2">
								<div class="input-group-addon"><i class="fa fa-info"></i></div>
								<input ng-model="pagedata.item.smscode" class="form-control" style="width:110px;" placeholder="请输入验证码">
								<a class="jy-btn jy-btn-default" href="javascript:;" id="sms_code" ng-click="tool.mobile_code({'mobile':pagedata.item.mobile,'imgcode':pagedata.item.code,'check_imgcode':pagedata.verify_code})" style="text-decoration: none;margin:2px 10px;padding:10px 12px">发送验证码</a>
					</div>
					<div class="form-group" ng-init="code_image('imgverify')">
						<div id="submit" style="text-align:center;" ng-click="post(pagedata.item,'login');" class="login-btn">登录平台</div>
						<!--<div ng-if="pagedata.wechat_scan_login" style="text-align:center;" ng-click="pagedata.wechat_scan_login()" class="login-btn">微信一键登录</div>-->
					</div>
				</div>
				<div class="form-group other-login-line">
					<div ng-show="pagedata.qq_login || pagedata.wechat_login" class="other-login-line"><div class="label"> 使用第三方账号登录 </div><div class="line"></div></div>
					<div class="other-login clearfix">
						<div ng-show="pagedata.qq_login" class="login-btn" ng-click="post({},'core/user.login/qq_login/')"><i class="fa fa-qq"></i></div>
						<div ng-show="pagedata.wechat_login" class="login-btn wechat" ng-click="post({},'core/user.login/wechat_login/')"><i class="fa fa-wechat"></i></div>
					</div>
					<div class="login-footer">还没有全网账号？<a class="action" href="javascript:;" ng-click="access_json(links('/user.register/'))">去注册</a></div>
				</div>
            </form>
			</div>
			<div class="forminfo" ng-if="pagedata.wxauth==1">
				<div class="form-group log-qrcode-cont" style="margin-top:50px">
					<div class="wap-qrcode-image" id="login_ewm" style="width:160px;margin:0 auto">
					</div>
					<div class="text"><i class="icon icon-saoyisao1"></i> 打开微信，扫一扫登录</div>
				</div>
				<div class="form-group other-login-line">
					<div ng-show="pagedata.qq_login || pagedata.wechat_login" class="other-login-line"><div class="label"> 使用第三方账号登录 </div><div class="line"></div></div>
					<div class="other-login clearfix">
						<div ng-show="pagedata.qq_login" class="login-btn" ng-click="post({},'core/user.login/qq_login/')"><i class="fa fa-qq"></i></div>
						<div ng-show="pagedata.wechat_login" class="login-btn wechat" ng-click="post({},'core/user.login/wechat_login/')"><i class="fa fa-wechat"></i></div>
					</div>
					<div class="login-footer">还没有全网账号？<a class="action" href="javascript:;" ng-click="access_json(links('/user.register/'))">去注册</a></div>
				</div>
			</div>
        </div>
    </div>
</div>
<div ng-include="sys_html('home/_footer',true)"></div>
<script>
scope.pagedata.wechat_scan_login=function(){
	var url=scope.tool.manage_url('core/user.login/wxauth_check/session_id='+scope.pagedata.session_id,true);
	scope.tool.qr(url,'login_ewm');
	scope.pagedata.wxauth=1;
	scope.tool.wechat_login(function(res){
		if(!res.message || !res.message.openid){
			scope.message('获取openid失败，微信登陆失败！');
		}
		if(res.to_uid==scope.pagedata.session_id){
			scope.pagedata.item.openid=res.message.openid;
			scope.post(scope.pagedata.item,'core/user.login/wechat_scan_login/');
		}
	});
}
</script>